.NETFoundations

Foundations path

From zero to DbContext. Each page needs only the pages above it.

  1. 1Class and objectA class is the blueprint; an object is one thing built from it.ready
  2. 2References and newA variable holds the address of an object, not the object itself. new makes the object.ready
  3. 3ConstructorThe code that runs once when an object is created, to set its starting values.ready
  4. 4Access modifierspublic, private, protected: who is allowed to see and change each part of a class.ready
  5. 5InheritanceA child class gets the parent class's data and methods. The parent's constructor runs first.ready
  6. 6Virtual and overrideA child replaces a parent's method; .NET picks the version from the real object while the app runs.ready
  7. 7Abstract classesA parent you cannot build directly; it can leave methods for each child to fill in.ready
  8. 8Sealed, and the two meanings of newsealed stops inheritance. new builds an object, or on a method hides the parent's one.ready
  9. 9InterfaceA contract: a list of methods a class promises to have, with no code inside.ready
  10. 10Composition: is-a vs has-aA class holds a part and calls it, instead of being a subclass. Use it when one behaviour varies on its own.ready
  11. 11List and IReadOnlyListA growable list of objects, and a read-only view of it you can hand out safely.ready
  12. 12Data vs behaviourSome classes mainly hold data (a loan); others mainly do work (a calculator).ready
  13. 13State and statelessWhat an object remembers between one method call and the next.ready
  14. 14Static vs instanceBelongs to the class itself, not to any one object. One shared copy.ready
  15. 15Dispose and garbage collectionReleasing things like database connections as soon as you are done, instead of waiting for the garbage collector.ready
  16. 16One HTTP requestThe path one web request takes from the browser, through the app, and back.ready
  17. 17Threads and thread-safetyOne line of work the computer runs. A web app runs many at once.ready
  18. 18TaskAn object that stands for work that finishes later, like an order slip.ready
  19. 19What is a service?An object whose job is to do work for other code.ready
  20. 20The DI containerThe part of .NET that builds your objects and hands them to the classes that need them. This is dependency injection.ready
  21. 21Registering servicesTelling the container, in Program.cs, which class to build for each need.ready
  22. 22Resolving a serviceAsking the container for an object.ready
  23. 23Scope and the root providerA short-lived group of objects, usually one per web request.ready
  24. 24ProblemDetailsThe standard JSON shape for an API error: type, title, status, and an id to find the logs.ready
  25. 25Correlation ID and trace IDOne id per request, on every log line and in the error the user sees.ready
  26. 26CORSThe browser rule that says which other websites may read the API's answers.ready
  27. 27Claims and ClaimsPrincipalSmall facts about the signed-in user, read from the token on every request.ready
  28. 28Resource-based authorization and BOLAChecking the user against the record they asked for, after loading it.ready
  29. 29Signing keys: HMAC vs RSAHow a token is signed so nobody can change it, and who holds which key.ready
  30. 30Refresh-token rotationEach refresh token works once; a used one coming back means it was copied.ready
  31. 31Filter lifetimeHow a filter is registered decides whether requests share one filter object.ready
  32. 32Endpoint filtersFilters for minimal APIs: code around one endpoint that sees its arguments.ready
  33. 33LINQC# syntax for filtering, sorting and shaping lists and database queries.to write
  34. 34ORM: what EF Core isA library that turns C# objects into database rows and back. EF Core is one.to write
  35. 35DbContext and change trackingEF Core's object that talks to the database and tracks what you changed.to write
  36. 36Unit of workSaving many changes together, so they all succeed or all fail.to write
  37. 37Repository patternA class that hides how data is stored behind simple methods like GetById.to write